package xyz.jiang.asteroid.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.jiang.asteroid.common.base.RestResponse;
import xyz.jiang.asteroid.pojo.dto.UserDTO;
import xyz.jiang.asteroid.service.LoginService;

@RestController
@RequestMapping("/system")
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("/login")
    public RestResponse login(@RequestBody UserDTO userDTO) {

        RestResponse login = loginService.login(userDTO);
        System.out.println(login);
        return login;
    }
}
